﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CoderJoe
{
    public class SimpleMathService
        : ISimpleMath
    {
        protected ISimpleMath Unwrapped { get; private set; }
        protected AspectContainer Container { get; private set; }

        #region ISimpleMath Members

        int ISimpleMath.Add(int x, int y)
        {
            int result = default(int);

            Action action = delegate()
            {
                result = Unwrapped.Add(x, y);
            };

            Container.Invoke(action);

            return result;
        }

        //void ISimpleMath.Add(int x, int y)
        //{
        //    Action action = delegate()
        //    {
        //        Unwrapped.Add(x, y);
        //    };

        //    Container.Invoke(action);
        //}

        #endregion
    }
}
